# coding=utf-8
import os

CSRF_ENABLED = True
SECRET_KEY = 'you-will-never-guess'
OPENID_PROVIDERS = [
    {'name': 'Google', 'url': 'https://www.google.com/accounts/o8/id'},
    {'name': 'Yahoo', 'url': 'http://openid.yahoo.com'},
    {'name': 'opcn', 'url': 'http://dodol.openid.org.cn/'},
    {'name': 'Flickr', 'url': 'http://www.flickr.com/<username>'},
    {'name': 'MyOpenID', 'url': 'https://www.myopenid.com'}]

basedir = os.path.abspath(os.path.dirname(__file__))

SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'app.db')
SQLALCHEMY_MIGRATE_REPO = os.path.join(basedir, 'db_repository')

SQLALCHEMY_TRACK_MODIFICATIONS = True

# 邮件发送配置
MAIL_SERVER = 'smtp.qq.com'
MAIL_PORT = 465
MAIL_USE_TLS = False
MAIL_USE_SSL = True
MAIL_DEBUG = False
MAIL_USERNAME = os.environ.get('MAIL_USERNAME') or '807363124@qq.com'
MAIL_PASSWORD = os.environ.get('MAIL_PASSWORD') or 'syqjezcaaqutbddd'

ADMINS = ['807363124@qq.com', 'xuedonglei@yftech.com']

# 分页，每页显示数量
POST_PER_PAGE = 3

# 全文检索配置
WHOOSH_BASE = os.path.join(basedir, 'search.db')
MAX_SEARCH_RESULT = 50


# 使用的语言
LANGUAGES = {
    'en': 'English',
    'es': 'Español'
}